<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="de.tuhrig.sportlog.pmf.PMF" %>
<%@ page import="de.tuhrig.sportlog.pmf.queries.QueryFactory" %>

<html>
	<head>
	
		<%@ include file="controls/Meta.jsp" %>
		
		<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
		<link href="/scripts/ptTimeSelect/jquery.ptTimeSelect.css" rel="stylesheet" type="text/css" />
  		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  		<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
		<script src="/scripts/ptTimeSelect/jquery.ptTimeSelect.js" type="text/javascript" language="JavaScript" ></script>

		<script language="JavaScript">
			$(document).ready(
				function () {
					$('code').each(
						function() {
							eval($(this).html());
						}
					)
				}
			);
			
			// Populate usage
			$(document).ready(function(){
				
				$.get(
					"../doc/files/jquery-ptTimeSelect-js.html",
					function(d){
						var h = jQuery(d).find("div.CFunction h3:contains('.ptTimeSelect')").closest(".CFunction");
						$("#usageDocMainMethod").empty().append(h);
					},
					"html");
				$.get(
					"../doc/files/jquery-ptTimeSelect-js.html",
					function(d){
						var h = $(d).find(".CHeading:contains('INSTALLATION') + .CParagraph");
						$("#usageDocInstallation").empty().append(h);
					}
				);
	
			});
		</script>

  		<script>
			$(function() {
				$( "#datepicker" ).datepicker();
			});
		</script>

		<script>
			$(function() {
				$('#timepicker input').ptTimeSelect(); 
			});
		</script>

	</head>
	
	<div id='container'>
		<%@ include file="controls/Header.jsp" %>
		<%@ include file="controls/Left.jsp" %>
		<%@ include file="controls/Right.jsp" %>
		
		<div id='content'>
			<% 
			    if(user != null) {
			%>
			<h1>Create a new Sport Log</h1>
			<p>
				Upload a new GPS log-file from your last run, walk or ride.
				Allowed formats are *.cvs or *.kml. For more Information see the <a href="FAQ.jsp">FAQ</a>.
			</p>
			<h3>Manuel:</h3>
				<div id='input'>
					<form name='input' action='/PostNewLogServlet' method='post'>
						<table class="createLog" width="100%">
							<tr>
								<td><b>Date:</b></td>
								<td><input type='text' name='date' id="datepicker" /></td>
							<td><b>e.g.</b> 22/01.2011</td>
							</tr>
							<tr>
								<td><b>Start:</b></td>
								<td><div id="timepicker"><input type='text' name='start' /></div></td>
								<td><b>e.g.</b> 1:13 PM</td>
							</tr>
							<tr>
								<td><b>End:</b></td>
								<td><div id="timepicker"><input type='text' name='end' /></div></td>
								<td><b>e.g.</b> 2:13 AM</td>
							</tr>
							<tr>
								<td><b>Distance:</b></td>
								<td><input type='text' name='distance' /></td>
								<td><b>e.g.</b> 10,5</td>
							</tr>
							<tr>
								<td><b>Location:</b></td>
								<td><input type='text' name='location' /></td>
								<td><b>e.g.</b> Stuttgart</td>
							</tr>
							<tr>
								<td><b>Activity:</b></td>
								<td>
									<select name="sport">
										<Option value=""></Option>
										<Option value="running">Running</Option>
										<Option value="cycling">Cycling</Option>
										<Option value="hiking">Hiking</Option>
									</select>
								</td>
								<td><b>e.g.</b> Running</td>
							</tr>
							<tr>
								<td><b>Comment:</b></td>
								<td><textarea type='text' name='comment' ></textarea></td>
								<td><b>e.g.</b> a long run</td>
							</tr>
						</table>
							
						<p><input type='submit' value='Submit' /></p>

					</form>
				</div>
			<%
			    }
			%>
		</div>
		<%@ include file="controls/Footer.jsp" %>
	</div>
</html>